﻿<!--
//*********************************************************
//
// Copyright (c) Microsoft. All rights reserved.
// THIS CODE IS PROVIDED *AS IS* WITHOUT WARRANTY OF
// ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING ANY
// IMPLIED WARRANTIES OF FITNESS FOR A PARTICULAR
// PURPOSE, MERCHANTABILITY, OR NON-INFRINGEMENT.
//
//*********************************************************
-->

<common:LayoutAwarePage
    x:Class="Tiles.NotificationExpiration"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:Tiles"
    xmlns:common="using:SDKTemplate.Common"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    mc:Ignorable="d">

    <Grid x:Name="LayoutRoot" Background="White" HorizontalAlignment="Left" VerticalAlignment="Top">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition Height="*"/>
        </Grid.RowDefinitions>
        <Grid x:Name="Input" Grid.Row="0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto"/>
                <RowDefinition Height="*"/>
            </Grid.RowDefinitions>
            <StackPanel>
                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" FontWeight="SemiBold">
                    In this scenario, expiration will be set on notifications so that they are not shown to the user after a specified date and time.
                </TextBlock>
                <TextBlock Style="{StaticResource BasicTextStyle}" TextWrapping="Wrap" Margin="0,10,0,0">
                    Push, periodic, and scheduled notifications have a default expiration time of 3 days.
                    Notifications sent locally from your app don't expire by default.
                    You can override this default to any valid date and time.
                    Your application should set an expiration time on each notification which corresponds to the useful lifetime of the individual notification.
                    For example, a notification for a one-day sale should expire at the end of the day.
                    If you never want a notification to expire, your app should set a sufficiently far away date, such as one year.
                    When a notification expires, it will be removed and the user will no longer be able to see that notification.
                    If the application tile does not have any notifications to display after a notification has expired it will display the default image specified in the manifest.
                </TextBlock>

                <TextBlock Style="{StaticResource BasicTextStyle}" VerticalAlignment="Center" TextWrapping="Wrap" Margin="0,20,0,0" FontWeight="SemiBold">
                    Number of seconds until notification will expire (leave empty for 10 seconds):
                </TextBlock>
                <StackPanel Orientation="Horizontal" >
                    <TextBox x:Name="Time" Text="" Margin="0,0,0,0" Width="200"/>
                </StackPanel>
                <Button x:Name="UpdateTileExpiring" Content="Send tile notification with an expiration date" Click="UpdateTileExpiring_Click" Margin="-3,0,0,0"/>
            </StackPanel>
        </Grid>

        <Grid x:Name="Output" HorizontalAlignment="Left" VerticalAlignment="Top" Grid.Row="1">
            <TextBlock x:Name="OutputTextBlock" Text="" TextWrapping="Wrap"  Style="{StaticResource BasicTextStyle}" IsTextSelectionEnabled="True"/>
        </Grid>

        <!-- Add Storyboards to the visual states below as necessary for supporting the various layouts -->
        <VisualStateManager.VisualStateGroups>
            <VisualStateGroup>
                <VisualState x:Name="DefaultLayout"/>
                <VisualState x:Name="Below768Layout"/>
            </VisualStateGroup>
        </VisualStateManager.VisualStateGroups>
    </Grid>

</common:LayoutAwarePage>